#! /usr/bin/python
# Filename: backup_ver1.py

import os
import time

sourcelist = ['/home/F1213366/python','/home/F1213366/work/code'];
target_dir = '/home/F1213366/backup/';
delimiter = ' ';
target = target_dir + time.strftime('%Y%m%d%H%M%S') + '.tar.gz';

tar_cmd = "tar -cf '%s' %s" % (target, delimiter.join(sourcelist));

print 'tar_cmd:',tar_cmd;

if os.system(tar_cmd) == 0:
	print 'Successful backup to',target;
else:
	print 'Backup FAILED!';
